package com.res.share.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@ConfigurationProperties(prefix = "res-share.thread")
@Component
public class ThreadPoolConfigProperties {
    private Integer coreSize;
    private Integer maxSize;
    private Integer keepAliveTime;

    //<editor-fold defaultstate="collapsed" desc="delombok">
    @SuppressWarnings("all")
    public ThreadPoolConfigProperties() {
    }

    @SuppressWarnings("all")
    public Integer getCoreSize() {
        return this.coreSize;
    }

    @SuppressWarnings("all")
    public Integer getMaxSize() {
        return this.maxSize;
    }

    @SuppressWarnings("all")
    public Integer getKeepAliveTime() {
        return this.keepAliveTime;
    }

    @SuppressWarnings("all")
    public void setCoreSize(final Integer coreSize) {
        this.coreSize = coreSize;
    }

    @SuppressWarnings("all")
    public void setMaxSize(final Integer maxSize) {
        this.maxSize = maxSize;
    }

    @SuppressWarnings("all")
    public void setKeepAliveTime(final Integer keepAliveTime) {
        this.keepAliveTime = keepAliveTime;
    }

    @Override
    @SuppressWarnings("all")
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof ThreadPoolConfigProperties)) return false;
        final ThreadPoolConfigProperties other = (ThreadPoolConfigProperties) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$coreSize = this.getCoreSize();
        final Object other$coreSize = other.getCoreSize();
        if (this$coreSize == null ? other$coreSize != null : !this$coreSize.equals(other$coreSize)) return false;
        final Object this$maxSize = this.getMaxSize();
        final Object other$maxSize = other.getMaxSize();
        if (this$maxSize == null ? other$maxSize != null : !this$maxSize.equals(other$maxSize)) return false;
        final Object this$keepAliveTime = this.getKeepAliveTime();
        final Object other$keepAliveTime = other.getKeepAliveTime();
        if (this$keepAliveTime == null ? other$keepAliveTime != null : !this$keepAliveTime.equals(other$keepAliveTime)) return false;
        return true;
    }

    @SuppressWarnings("all")
    protected boolean canEqual(final Object other) {
        return other instanceof ThreadPoolConfigProperties;
    }

    @Override
    @SuppressWarnings("all")
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $coreSize = this.getCoreSize();
        result = result * PRIME + ($coreSize == null ? 43 : $coreSize.hashCode());
        final Object $maxSize = this.getMaxSize();
        result = result * PRIME + ($maxSize == null ? 43 : $maxSize.hashCode());
        final Object $keepAliveTime = this.getKeepAliveTime();
        result = result * PRIME + ($keepAliveTime == null ? 43 : $keepAliveTime.hashCode());
        return result;
    }

    @Override
    @SuppressWarnings("all")
    public String toString() {
        return "ThreadPoolConfigProperties(coreSize=" + this.getCoreSize() + ", maxSize=" + this.getMaxSize() + ", keepAliveTime=" + this.getKeepAliveTime() + ")";
    }
    //</editor-fold>
}
